home *** CD-ROM | disk | FTP | other *** search
/ PD ROM 1 / PD ROM Volume I - Macintosh Software from BMUG (1988).iso / Stacks / Hyper Education / Mathematics / Subtraction / card_5832.txt < prev    next >
Encoding:
Text File  |  1988-04-19  |  11.6 KB  |  510 lines

  1. -- card: 5832 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 5081
  5. -- name: 
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 00
  10. -- high flags: 8003
  11. -- rect: left=354 top=102 right=139 bottom=468
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Next Problem
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   if field "Flag" = 0 then exit mouseUp
  23.   show button "Smiley"
  24.   show button "Frowney"
  25.   put empty into field "Comment"
  26.   put "  " into field "Minuend"
  27.   put "  " into field "Subtrahend"
  28.   put empty into field "Difference"
  29.   if field "Attempts" = second word of bkgnd field "Options" then
  30.     put field "Attempts" into attempts
  31.     put field "Correct" into correct
  32.     put field "Percent" into percent
  33.     put field "Name" into name
  34.     put third word of field "Options" into skill
  35.     put "O" into field "Attempts"
  36.     put "O" into field "Correct"
  37.     put "O" into field "Percent"
  38.     set the lockScreen to true
  39.     set the cursor to 4
  40.     go to first card of bkgnd "Users"
  41.     rotateData
  42.     put name into line 1 of field "name"
  43.     put the date into line 1 of field "Date"
  44.     put skill into line 1 of field "Skill"
  45.     put attempts into line 1 of field "Attempts"
  46.     put correct into line 1 of field "Correct"
  47.     put percent into line 1 of field "Percent"
  48.     pop card
  49.     exit mouseUp
  50.   end if
  51.   get the random of 80
  52.   add 9 to it
  53.   put it into num1
  54.   if char 2 of num1=0 then add 1 to num1
  55.   put "  " into num2
  56.   put 10 into it
  57.   subtract second char of num1 from it
  58.   put it into second char of num2
  59.   put 7 into it
  60.   subtract first char of num1 from it
  61.   if it>0 then put it into first char of num2
  62.   put num1 into num3
  63.   add num2 to num3
  64.   put num3 into field "Minuend"
  65.   put num2 into field "Subtrahend"
  66.   put "   " into field "Difference"
  67.   put "0" into field "Flag"
  68.   put "?" into char 3 of field "Difference"
  69. end mouseUp
  70.  
  71. on rotateData
  72.   repeat with x = 11 down to 1
  73.     if line x of field "Name" is empty then next repeat
  74.     put x into nextLine
  75.     add 1 to nextLine
  76.     get line x of field "Name"
  77.     put it into line nextLine of field "Name"
  78.     get line x of field "Date"
  79.     put it into line nextLine of field "Date"
  80.     get line x of field "Skill"
  81.     put it into line nextLine of field "Skill"
  82.     get line x of field "Attempts"
  83.     put it into line nextLine of field "Attempts"
  84.     get line x of field "Correct"
  85.     put it into line nextLine of field "Correct"
  86.     get line x of field "Percent"
  87.     put it into line nextLine of field "Percent"
  88.   end repeat
  89. end rotateData
  90.  
  91.  
  92.  
  93.  
  94. -- part 2 (button)
  95. -- low flags: 00
  96. -- high flags: 8003
  97. -- rect: left=355 top=161 right=194 bottom=388
  98. -- title width / last selected line: 0
  99. -- icon id / first selected line: 0 / 0
  100. -- text alignment: 1
  101. -- font id: 0
  102. -- text size: 12
  103. -- style flags: 0
  104. -- line height: 16
  105. -- part name: 7
  106. ----- HyperTalk script -----
  107. on mouseUp
  108.   repeat with x=3 down to 2
  109.     if char x of field "Difference" is "?" then
  110.       put "7" into char x of field "Difference"
  111.       put x into it
  112.       subtract 1 from it
  113.       if  x>2 then put "?" into char it of field "Difference"
  114.       exit mouseUp
  115.     end if
  116.   end repeat
  117. end mouseUp
  118.  
  119.  
  120.  
  121. -- part 3 (button)
  122. -- low flags: 00
  123. -- high flags: 8003
  124. -- rect: left=395 top=161 right=194 bottom=427
  125. -- title width / last selected line: 0
  126. -- icon id / first selected line: 0 / 0
  127. -- text alignment: 1
  128. -- font id: 0
  129. -- text size: 12
  130. -- style flags: 0
  131. -- line height: 16
  132. -- part name: 8
  133. ----- HyperTalk script -----
  134. on mouseUp
  135.   repeat with x=3 down to 1
  136.     if char x of field "Difference" is "?" then
  137.       put "8" into char x of field "Difference"
  138.       put x into it
  139.       subtract 1 from it
  140.       if  x>2 then put "?" into char it of field "Difference"
  141.       exit mouseUp
  142.     end if
  143.   end repeat
  144. end mouseUp
  145.  
  146.  
  147.  
  148. -- part 4 (button)
  149. -- low flags: 00
  150. -- high flags: 8003
  151. -- rect: left=435 top=162 right=194 bottom=467
  152. -- title width / last selected line: 0
  153. -- icon id / first selected line: 0 / 0
  154. -- text alignment: 1
  155. -- font id: 0
  156. -- text size: 12
  157. -- style flags: 0
  158. -- line height: 16
  159. -- part name: 9
  160. ----- HyperTalk script -----
  161. on mouseUp
  162.   repeat with x=3 down to 1
  163.     if char x of field "Difference" is "?" then
  164.       put "9" into char x of field "Difference"
  165.       put x into it
  166.       subtract 1 from it
  167.       if  x>2 then put "?" into char it of field "Difference"
  168.       exit mouseUp
  169.     end if
  170.   end repeat
  171. end mouseUp
  172.  
  173.  
  174.  
  175. -- part 5 (button)
  176. -- low flags: 00
  177. -- high flags: 8003
  178. -- rect: left=356 top=201 right=233 bottom=389
  179. -- title width / last selected line: 0
  180. -- icon id / first selected line: 0 / 0
  181. -- text alignment: 1
  182. -- font id: 0
  183. -- text size: 12
  184. -- style flags: 0
  185. -- line height: 16
  186. -- part name: 4
  187. ----- HyperTalk script -----
  188. on mouseUp
  189.   repeat with x=3 down to 1
  190.     if char x of field "Difference" is "?" then
  191.       put "4" into char x of field "Difference"
  192.       put x into it
  193.       subtract 1 from it
  194.       if  x>2 then put "?" into char it of field "Difference"
  195.       exit mouseUp
  196.     end if
  197.   end repeat
  198. end mouseUp
  199.  
  200.  
  201.  
  202. -- part 6 (button)
  203. -- low flags: 00
  204. -- high flags: 8003
  205. -- rect: left=395 top=202 right=234 bottom=428
  206. -- title width / last selected line: 0
  207. -- icon id / first selected line: 0 / 0
  208. -- text alignment: 1
  209. -- font id: 0
  210. -- text size: 12
  211. -- style flags: 0
  212. -- line height: 16
  213. -- part name: 5
  214. ----- HyperTalk script -----
  215. on mouseUp
  216.   repeat with x=3 down to 1
  217.     if char x of field "Difference" is "?" then
  218.       put "5" into char x of field "Difference"
  219.       put x into it
  220.       subtract 1 from it
  221.       if  x>2 then put "?" into char it of field "Difference"
  222.       exit mouseUp
  223.     end if
  224.   end repeat
  225. end mouseUp
  226.  
  227.  
  228.  
  229. -- part 7 (button)
  230. -- low flags: 00
  231. -- high flags: 8003
  232. -- rect: left=435 top=201 right=233 bottom=466
  233. -- title width / last selected line: 0
  234. -- icon id / first selected line: 0 / 0
  235. -- text alignment: 1
  236. -- font id: 0
  237. -- text size: 12
  238. -- style flags: 0
  239. -- line height: 16
  240. -- part name: 6
  241. ----- HyperTalk script -----
  242. on mouseUp
  243.   repeat with x=3 down to 1
  244.     if char x of field "Difference" is "?" then
  245.       put "6" into char x of field "Difference"
  246.       put x into it
  247.       subtract 1 from it
  248.       if  x>2 then put "?" into char it of field "Difference"
  249.       exit mouseUp
  250.     end if
  251.   end repeat
  252. end mouseUp
  253.  
  254.  
  255.  
  256. -- part 8 (button)
  257. -- low flags: 00
  258. -- high flags: 8003
  259. -- rect: left=356 top=242 right=274 bottom=389
  260. -- title width / last selected line: 0
  261. -- icon id / first selected line: 0 / 0
  262. -- text alignment: 1
  263. -- font id: 0
  264. -- text size: 12
  265. -- style flags: 0
  266. -- line height: 16
  267. -- part name: 1
  268. ----- HyperTalk script -----
  269. on mouseUp
  270.   repeat with x=3 down to 1
  271.     if char x of field "Difference" is "?" then
  272.       put "1" into char x of field "Difference"
  273.       put x into it
  274.       subtract 1 from it
  275.       if  x>2 then put "?" into char it of field "Difference"
  276.       exit mouseUp
  277.     end if
  278.   end repeat
  279. end mouseUp
  280.  
  281.  
  282.  
  283. -- part 9 (button)
  284. -- low flags: 00
  285. -- high flags: 8003
  286. -- rect: left=395 top=241 right=273 bottom=428
  287. -- title width / last selected line: 0
  288. -- icon id / first selected line: 0 / 0
  289. -- text alignment: 1
  290. -- font id: 0
  291. -- text size: 12
  292. -- style flags: 0
  293. -- line height: 16
  294. -- part name: 2
  295. ----- HyperTalk script -----
  296. on mouseUp
  297.   repeat with x=3 down to 1
  298.     if char x of field "Difference" is "?" then
  299.       put "2" into char x of field "Difference"
  300.       put x into it
  301.       subtract 1 from it
  302.       if  x>2 then put "?" into char it of field "Difference"
  303.       exit mouseUp
  304.     end if
  305.   end repeat
  306. end mouseUp
  307.  
  308.  
  309.  
  310. -- part 10 (button)
  311. -- low flags: 00
  312. -- high flags: 8003
  313. -- rect: left=436 top=242 right=274 bottom=468
  314. -- title width / last selected line: 0
  315. -- icon id / first selected line: 0 / 0
  316. -- text alignment: 1
  317. -- font id: 0
  318. -- text size: 12
  319. -- style flags: 0
  320. -- line height: 16
  321. -- part name: 3
  322. ----- HyperTalk script -----
  323. on mouseUp
  324.   repeat with x=3 down to 1
  325.     if char x of field "Difference" is "?" then
  326.       put "3" into char x of field "Difference"
  327.       put x into it
  328.       subtract 1 from it
  329.       if  x>2 then put "?" into char it of field "Difference"
  330.       exit mouseUp
  331.     end if
  332.   end repeat
  333. end mouseUp
  334.  
  335.  
  336.  
  337. -- part 11 (button)
  338. -- low flags: 00
  339. -- high flags: 8003
  340. -- rect: left=355 top=281 right=313 bottom=407
  341. -- title width / last selected line: 0
  342. -- icon id / first selected line: 0 / 0
  343. -- text alignment: 1
  344. -- font id: 0
  345. -- text size: 12
  346. -- style flags: 0
  347. -- line height: 16
  348. -- part name: 0
  349. ----- HyperTalk script -----
  350. on mouseUp
  351.   repeat with x=3 down to 1
  352.     if char x of field "Difference" is "?" then
  353.       put "0" into char x of field "Difference"
  354.       put x into it
  355.       subtract 1 from it
  356.       if  x>2 then put "?" into char it of field "Difference"
  357.       exit mouseUp
  358.     end if
  359.   end repeat
  360. end mouseUp
  361.  
  362.  
  363.  
  364. -- part 12 (button)
  365. -- low flags: 00
  366. -- high flags: 8003
  367. -- rect: left=414 top=281 right=313 bottom=468
  368. -- title width / last selected line: 0
  369. -- icon id / first selected line: 0 / 0
  370. -- text alignment: 1
  371. -- font id: 0
  372. -- text size: 12
  373. -- style flags: 0
  374. -- line height: 16
  375. -- part name: Enter
  376. ----- HyperTalk script -----
  377. on mouseUp
  378.   global answer
  379.   if field "Difference" < 1 then exit mouseUp
  380.   if field "Flag" > 0 then exit mouseUp
  381.   put field "Minuend" into answer
  382.   subtract field "Subtrahend" from answer
  383.   add 1 to field "Attempts"
  384.   if field "Difference" = answer then
  385.     add 1 to field "Correct"
  386.     get field "Correct"
  387.     divide it by field "Attempts"
  388.     multiply it by 100
  389.     put round(it) into field "Percent"
  390.     celebrate
  391.   else
  392.     get field "Correct"
  393.     divide it by field "Attempts"
  394.     multiply it by 100
  395.     put round(it) into field "Percent"
  396.     nag
  397.   end if
  398. end mouseUp
  399.  
  400. on celebrate
  401.   put "Correct" into line 1 of field "Comment"
  402.   put first word of bkgnd field "Name" into line 2 of field "Comment"
  403.   hide button "Smiley"
  404.   put "1" into field "Flag"
  405.   if first word of bkgnd field "Options" = "Y" then
  406.     play "Harpsichord" tempo 200 "g4e c5 e gh eq gh"
  407.   end if
  408. end celebrate
  409.  
  410. on nag
  411.   global answer
  412.   put "WRONG!" into line 1 of field "Comment"
  413.   put "The answer is "& answer & "." into line 3 of field "Comment"
  414.   hide button "Frowney"
  415.   put "2" into field "Flag"
  416.   if first word of bkgnd field "Options" = "Y" then
  417.     play "boing" tempo 200 "gq c e a"
  418.   end if
  419. end nag
  420.  
  421.  
  422.  
  423. -- part 13 (button)
  424. -- low flags: 00
  425. -- high flags: 8003
  426. -- rect: left=3 top=306 right=338 bottom=67
  427. -- title width / last selected line: 0
  428. -- icon id / first selected line: 0 / 0
  429. -- text alignment: 1
  430. -- font id: 0
  431. -- text size: 12
  432. -- style flags: 0
  433. -- line height: 16
  434. -- part name: Quit
  435. ----- HyperTalk script -----
  436. on mouseUp
  437.   go to first card
  438. end mouseUp
  439.  
  440.  
  441.  
  442. -- part 14 (button)
  443. -- low flags: 00
  444. -- high flags: 0001
  445. -- rect: left=249 top=88 right=181 bottom=349
  446. -- title width / last selected line: 0
  447. -- icon id / first selected line: 0 / 0
  448. -- text alignment: 1
  449. -- font id: 0
  450. -- text size: 12
  451. -- style flags: 0
  452. -- line height: 16
  453. -- part name: Frowney
  454.  
  455.  
  456. -- part 15 (button)
  457. -- low flags: 80
  458. -- high flags: 0001
  459. -- rect: left=14 top=87 right=178 bottom=110
  460. -- title width / last selected line: 0
  461. -- icon id / first selected line: 0 / 0
  462. -- text alignment: 1
  463. -- font id: 0
  464. -- text size: 12
  465. -- style flags: 0
  466. -- line height: 16
  467. -- part name: Smiley
  468.  
  469.  
  470. -- part contents for background part 4
  471. ----- text -----
  472. 80
  473.  
  474. -- part contents for background part 5
  475. ----- text -----
  476. 59
  477.  
  478. -- part contents for background part 8
  479. ----- text -----
  480. 1
  481.  
  482. -- part contents for background part 1
  483. ----- text -----
  484. 2
  485.  
  486. -- part contents for background part 2
  487. ----- text -----
  488. 2
  489.  
  490. -- part contents for background part 3
  491. ----- text -----
  492. 100
  493.  
  494. -- part contents for background part 9
  495. ----- text -----
  496. Y 10 4
  497.  
  498. -- part contents for background part 10
  499. ----- text -----
  500. larry
  501.  
  502.  
  503. -- part contents for background part 6
  504. ----- text -----
  505.  21
  506.  
  507. -- part contents for background part 7
  508. ----- text -----
  509. Correct
  510. larry